package com.gzz.mybatis.common.conditices.rule;

import java.text.MessageFormat;

/**
 *
 * @author higmd
 */
public class BetweenRegular extends AbstractRegular{
    private final Object value1;
    private final Object value2;

    public BetweenRegular(String fieldName,SqlSymbol symbol, SqlSymbol previous, Object value1, Object value2) {
        super(fieldName, symbol, previous);
        this.value1 = value1;
        this.value2 = value2;
    }
    @Override
    public String resolveExpression() {
        return MessageFormat.format(" {0} between {1} and {2}", this.fieldName,  formatterValue(this.value1), formatterValue(this.value2));
    }
}
